package com.example.do_thing.controller;

import com.example.do_thing.bean.Depart;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

@RestController
public class DepartController {


    @Value(value = "${test.name:LiSi}")
    private String name;

    @GetMapping("provider/depart/list")
    public List<Depart> listHandle() {
        try {
            Thread.sleep(3000);
//            throw new RuntimeException();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        List<Depart> objects = new ArrayList<>();

        Depart depart = new Depart();
        depart.setName("请求返成功132 - " + name);
        objects.add(depart);
        return objects;
    }
}
